<?php
class c_public_function extends CI_Controller {
	function __construct(){
		parent::__construct();
	}
	function index(){
		$task = secure_post('task');
		switch($task){
			case "cabang":
				$this->_cabang();
				break;
			case "pekerjaan":
				$this->_pekerjaan();
				break;
			case "keuangan":
				$this->_keuangan();
				break;
			case "pendanaan":
				$this->_pendanaan();
				break;
			case "proyek":
				$this->_proyek();
				break;
			case "mandor":
				$this->_mandor();
				break;
			case "pembayaran":
				$this->_pembayaran();
				break;
			default : 
				redirect(base_url());
		}
	}
	
	function _cabang(){
		echo json_encode($this->m_public_function->_cabang());
		
	}
	
	function _pekerjaan(){
        $mandor_id = numeric_post("mandor_id");
		echo json_encode($this->m_public_function->_pekerjaan($mandor_id));
		
	}
	function _keuangan(){
		echo json_encode($this->m_public_function->_keuangan());
		
	}
	function _pendanaan(){
		echo json_encode($this->m_public_function->_pendanaan());
		
	}
	function _proyek(){
		echo json_encode($this->m_public_function->_proyek());
		
	}
	function _mandor(){
		echo json_encode($this->m_public_function->_mandor());
		
	}
	function _pembayaran(){
		echo json_encode($this->m_public_function->_pembayaran());
		
	}
}